/**
 *格式化时间
 */

exports.formatDate = time => {
  let tmpDate = new Date(time);
  let year = tmpDate.getFullYear();
  let mathon = tmpDate.getMonth() + 1;
  let day = tmpDate.getDate();
  let hours = tmpDate.getHours();
  let minutes = tmpDate.getMinutes();
  return year + "." + mathon + "." + day + " " + hours + ":" + minutes;
};
/*
* 格式化金钱
*/
exports.formatMoney = value => {
if (value !== undefined) {
    return Number(value).toFixed(2)
  }
};
/*
* 隐藏用户手机号中间四位
*/
exports.hidePhone = phone => {
  if (phone !== undefined) {
    return phone.replace(/(\d{3})\d{4}(\d{4})/, '$1****$2')
  }
};
/*
* 隐藏用户手机号中间四位
*/
exports.splitImg = strings => {
  return strings.split(",")[0];
};
 

 